<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="../_template.xhtml">


	<ui:define name="conteudo">
		<h:form id="quarto">
			<p:messages autoUpdate="true" />
			<p:growl autoUpdate="true" />

			<p:fieldset legend="Dados do Quarto">
				<p:message for="numero" id="messageNome" />

				<p:panelGrid columns="2">

					<h:outputLabel value="Numero: " for="numero" />
					<p:inputText id="numero" value="#{quartoMB.quarto.numero}"
						required="true" requiredMessage="Numero Obrigatório">
						<f:validateLength minimum="1" maximun="20" />
						<f:ajax event="blur" render="messageNome" />
					</p:inputText>

					<h:outputLabel value="Categoria: " for="categoria" />
					<p:selectOneMenu name="select" id="categoria"
						value="#{quartoMB.categoriaId}">
						<f:selectItems value="#{quartoMB.listaCategorias}"
							var="categoria" itemLabel="#{categoria.categoria}"
							itemValue="#{categoria.id}" />
					</p:selectOneMenu>
				</p:panelGrid>
				<p:commandButton value="Gravar" action="#{quartoMB.gravar}" />
			</p:fieldset>
		</h:form>
	</ui:define>

</ui:composition>


</html>